import React, { Component } from 'react';
import { globalContext } from './globalData/js/globalData'
class StrideChild3 extends Component {
    state = {  
        a:20,
        b:12
    } 
    render() { 
        return (<div>
            子组件child3,使用contextType简化Consumer
            <br />
            {/*  使用contextType读取全局共享数据*/}
            role:{this.context.role}<br/>
            amdin:{this.context.tel}
            <button onClick={()=>this.context.updateRole('lisi')}>context-updateRole-修改role</button>
        </div>);
    }
}
StrideChild3.contextType=globalContext
export default StrideChild3;